<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
	<script>
		
		//arr[arr.length] = 4
		// 1、末尾追加数据 push  返回值是 原数组的（推入数据之后）长度
		//Array.push(par1)
		//var arr = [1,2,3]
		//var len = arr.push(4,5,6)
		//console.log(arr)
		//console.log(len)

		// 2、末尾删除数据 pop 返回值：被删除的数据（数组的最后一项）
		// Array.pop()


		//var arr = [1,2,3]
		//var res = arr.pop()
		//console.log(arr)
		//console.log(res)


		// 3、头部删除
		// Array.shift()

		//var arr = [1,2,3,4,5,6]
		//var res  = arr.shift()
		//console.log(arr)
		//console.log(res)

		// 4、 头部推入数据

		var arr = [1,2,3,4]
		var res = arr.unshift(-2,-1-0)
		console.log(arr)
		console.log(res)



		//Array.unshift()
		//var arr = [1,2,3,4,5]
		//var len = arr.unshift("a","b","c")
		//console.log(arr)
		//console.log(len)
		//var arr = [1,2,3,4]
		//var a = arr.push([654,45])
		//console.log(a)
		//console.log(arr.push([654,45]))
		//var b = arr.pop()
		//console.log(b)
		//console.log(arr.pop())
		//console.log(arr)
		//arr.unshift(1,2,3)
		//var res = arr.shift()
		//console.log(arr.length)

			
			

	</script>
 </body>
</html>
